<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<!-- <li>
								用户编号：<input type="text" name="userId"/>
							</li>

							<li>
								发现地址：<input type="text" name="foundAddress"/>
							</li>

							<li>
								宠物品种：<input type="text" name="petType"/>
							</li>

							<li>
								信息详情：<input type="text" name="foundDetail"/>
							</li>		 -->
							
							<li class="select-time">
							    <label>发布时间： </label>
							    <input type="text" class="time-input" id="createstartTime" placeholder="开始时间" name="params[createbeginTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="createendTime" placeholder="结束时间" name="params[createendTime]"/>
								<!-- 交易时间：<input type="text" name="chargeTime"/> -->
							</li>


							<!-- <li>
								宠物颜色：<input type="text" name="petColor"/>
							</li> -->

							<!--  <li>
								显示状态：<select  name="isShow" id="isShow" onchange="$.table.search()" >
                                <option ></option>
                                <option value="0">下架</option>
                                <option value="1">上架显示</option>
                                </select>
							</li>-->

							<li class="select-time">
							
							<label >招领状态：</label>
							
                               <select  name="foundState" id="foundState" onchange="$.table.search()" >
                                <option ></option>
                                <option value="0">未认领</option>
                                <option value="1">已认领 </option>
                               
                                </select>
                                
							</li>

							
							
							<li class="select-time">
							
							<label >招领类型： </label>
                               <select  name="foundType" id="foundType" onchange="$.table.search()" >
                                <option ></option>
                                <option value="0">未被招领</option>
                                <option value="1">主人</option>
                                <option value="2">领养</option>
                               
                                </select>
                                
							</li>

							
							<li class="select-time">
							
							<label >审核状态： </label>
                               <select  name="checkState" id="checkState" onchange="$.table.search()" >
                                <option ></option>
                                <option value="0">未审核</option>
                                <option value="1">审核通过</option>
                                <option value="2">未通过</option>
                               
                                </select>
                                
							</li>

							<!-- <li>
								审核时间：<input type="text" name="checkDate"/>
							</li> -->

							
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="gxgw_modules:found:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="gxgw_modules:found:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('gxgw_modules:found:edit')}]];
        var removeFlag = [[${@permission.hasPermi('gxgw_modules:found:remove')}]];
        var prefix = ctx + "gxgw_modules/found";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "宠物招领记录",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'foundId', 
					title : '序号',
					visible: false
				},
				{
					field : 'userId', 
					title : '用户编号',
					sortable: true
				},
				{
					field : 'foundAddress', 
					title : '发现地址',
					sortable: true
				},
				{
					field : 'petType', 
					title : '宠物品种',
					sortable: true
				},
				{
					field : 'foundDetail', 
					title : '信息详情',
					sortable: true,
				},
				{
					field : 'createDate', 
					title : '发布时间',
					sortable: true
				},
				{
					field : 'foundUrl', 
					title : '宠物图片',
					sortable: true
				},
				{
					field : 'petColor', 
					title : '宠物颜色',
					sortable: true
				},
				{
					field : 'isShow', 
					title : '显示状态',  
					sortable: true,
					formatter: function (value) {
						switch (value) {
							case 0:
								return '下架'
							case 1:
								return '上架显示'
							
						}
					}
				},
				{
					field : 'foundState', 
					title : '招领状态',
					sortable: true,
					formatter: function (value) {
						switch (value) {
							case 0:
								return '未认领'
							case 1:
								return '已认领'
							
						}
					}
				},
				{
					field : 'foundType', 
					title : '招领类型',
					sortable: true,
					formatter: function (value) {
						switch (value) {
						    case 0:
							    return '未被招领'
							case 1:
								return '主人'
							case 2:
								return '领养'
							
						}
					}
				},
				{
					field : 'checkState', 
					title : '审核状态',
					sortable: true,
					formatter: function (value) {
						switch (value) {
							case 0:
								return '未审核'
							case 1:
								return '审核通过'
							case 2:
								return '审核不通过'
							
						}
					}
				},
				{
					field : 'checkDate', 
					title : '审核时间',
					sortable: true
				},
				{
					field : 'checkAdmin', 
					title : '审核管理员',
					sortable: true
				},
				
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.foundId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.foundId + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>